<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: ActionView::Base</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">ActionView::Base</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/rails/actionpack/lib/action_view/base_rb.html">
                vendor/rails/actionpack/lib/action_view/base.rb
                </a>
        <br />
                <a href="../../files/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper_rb.html">
                vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb
                </a>
        <br />
                <a href="../../files/vendor/rails/actionpack/lib/action_view/helpers/form_helper_rb.html">
                vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
Action View templates can be written in three ways. If the template file
has a +.erb+ (or +.rhtml+) extension then it uses a mixture of ERb
(included in Ruby) and HTML. If the template file has a +.builder+ (or
+.rxml+) extension then Jim Weirich&#8216;s <a
href="../Builder/XmlMarkup.html">Builder::XmlMarkup</a> library is used. If
the template file has a +.rjs+ extension then it will use
ActionView::Helpers::PrototypeHelper::JavaScriptGenerator.
</p>
<h1>ERb</h1>
<p>
You trigger ERb by using embeddings such as &lt;% %&gt;, &lt;% -%&gt;, and
&lt;%= %&gt;. The &lt;%= %&gt; tag set is used when you want output.
Consider the following loop for names:
</p>
<pre>
  &lt;b&gt;Names of all the people&lt;/b&gt;
  &lt;% for person in @people %&gt;
    Name: &lt;%= person.name %&gt;&lt;br/&gt;
  &lt;% end %&gt;
</pre>
<p>
The loop is setup in regular embedding tags &lt;% %&gt; and the name is
written using the output embedding tag &lt;%= %&gt;. Note that this is not
just a usage suggestion. Regular output functions like print or puts
won&#8216;t work with ERb templates. So this would be wrong:
</p>
<pre>
  Hi, Mr. &lt;% puts &quot;Frodo&quot; %&gt;
</pre>
<p>
If you absolutely must write from within a function, you can use the
TextHelper#concat
</p>
<p>
&lt;%- and -%&gt; suppress leading and trailing whitespace, including the
trailing newline, and can be used interchangeably with &lt;% and %&gt;.
</p>
<h2>Using sub templates</h2>
<p>
Using sub templates allows you to sidestep tedious replication and extract
common display structures in shared templates. The classic example is the
use of a header and footer (even though the Action Pack-way would be to use
Layouts):
</p>
<pre>
  &lt;%= render &quot;shared/header&quot; %&gt;
  Something really specific and terrific
  &lt;%= render &quot;shared/footer&quot; %&gt;
</pre>
<p>
As you see, we use the output embeddings for the render methods. The render
call itself will just return a string holding the result of the rendering.
The output embedding writes it to the current template.
</p>
<p>
But you don&#8216;t have to restrict yourself to static includes. Templates
can share variables amongst themselves by using instance variables defined
using the regular embedding tags. Like this:
</p>
<pre>
  &lt;% @page_title = &quot;A Wonderful Hello&quot; %&gt;
  &lt;%= render &quot;shared/header&quot; %&gt;
</pre>
<p>
Now the header can pick up on the @page_title variable and use it for
outputting a title tag:
</p>
<pre>
  &lt;title&gt;&lt;%= @page_title %&gt;&lt;/title&gt;
</pre>
<h2>Passing local variables to sub templates</h2>
<p>
You can pass local variables to sub templates by using a hash with the
variable names as keys and the objects as values:
</p>
<pre>
  &lt;%= render &quot;shared/header&quot;, { :headline =&gt; &quot;Welcome&quot;, :person =&gt; person } %&gt;
</pre>
<p>
These can now be accessed in shared/header with:
</p>
<pre>
  Headline: &lt;%= headline %&gt;
  First name: &lt;%= person.first_name %&gt;
</pre>
<p>
If you need to find out whether a certain local variable has been assigned
a value in a particular render call, you need to use the following pattern:
</p>
<pre>
  &lt;% if local_assigns.has_key? :headline %&gt;
    Headline: &lt;%= headline %&gt;
  &lt;% end %&gt;
</pre>
<p>
Testing using <tt>defined? headline</tt> will not work. This is an
implementation restriction.
</p>
<h2>Template caching</h2>
<p>
By default, <a href="../Rails.html">Rails</a> will compile each template to
a method in order to render it. When you alter a template, <a
href="../Rails.html">Rails</a> will check the file&#8216;s modification
time and recompile it.
</p>
<h2><a href="../Builder.html">Builder</a></h2>
<p>
<a href="../Builder.html">Builder</a> templates are a more programmatic
alternative to ERb. They are especially useful for generating XML content.
An <tt>XmlMarkup</tt> object named <tt>xml</tt> is automatically made
available to templates with a +.builder+ extension.
</p>
<p>
Here are some basic examples:
</p>
<pre>
  xml.em(&quot;emphasized&quot;)                              # =&gt; &lt;em&gt;emphasized&lt;/em&gt;
  xml.em { xml.b(&quot;emph &amp; bold&quot;) }                    # =&gt; &lt;em&gt;&lt;b&gt;emph &amp;amp; bold&lt;/b&gt;&lt;/em&gt;
  xml.a(&quot;A Link&quot;, &quot;href&quot;=&gt;&quot;http://onestepback.org&quot;) # =&gt; &lt;a href=&quot;http://onestepback.org&quot;&gt;A Link&lt;/a&gt;
  xml.target(&quot;name&quot;=&gt;&quot;compile&quot;, &quot;option&quot;=&gt;&quot;fast&quot;)   # =&gt; &lt;target option=&quot;fast&quot; name=&quot;compile&quot;\&gt;
                                                    # NOTE: order of attributes is not specified.
</pre>
<p>
Any method with a block will be treated as an XML markup tag with nested
markup in the block. For example, the following:
</p>
<pre>
  xml.div {
    xml.h1(@person.name)
    xml.p(@person.bio)
  }
</pre>
<p>
would produce something like:
</p>
<pre>
  &lt;div&gt;
    &lt;h1&gt;David Heinemeier Hansson&lt;/h1&gt;
    &lt;p&gt;A product of Danish Design during the Winter of '79...&lt;/p&gt;
  &lt;/div&gt;
</pre>
<p>
A full-length RSS example actually used on Basecamp:
</p>
<pre>
  xml.rss(&quot;version&quot; =&gt; &quot;2.0&quot;, &quot;xmlns:dc&quot; =&gt; &quot;http://purl.org/dc/elements/1.1/&quot;) do
    xml.channel do
      xml.title(@feed_title)
      xml.link(@url)
      xml.description &quot;Basecamp: Recent items&quot;
      xml.language &quot;en-us&quot;
      xml.ttl &quot;40&quot;

      for item in @recent_items
        xml.item do
          xml.title(item_title(item))
          xml.description(item_description(item)) if item_description(item)
          xml.pubDate(item_pubDate(item))
          xml.guid(@person.firm.account.url + @recent_items.url(item))
          xml.link(@person.firm.account.url + @recent_items.url(item))

          xml.tag!(&quot;dc:creator&quot;, item.author_name) if item_has_creator?(item)
        end
      end
    end
  end
</pre>
<p>
More builder documentation can be found at <a
href="http://builder.rubyforge.org">builder.rubyforge.org</a>.
</p>
<h2>JavaScriptGenerator</h2>
<p>
JavaScriptGenerator templates end in +.rjs+. Unlike conventional templates
which are used to render the results of an action, these templates generate
instructions on how to modify an already rendered page. This makes it easy
to modify multiple elements on your page in one declarative Ajax response.
Actions with these templates are called in the background with Ajax and
make updates to the page where the request originated from.
</p>
<p>
An instance of the JavaScriptGenerator object named <tt>page</tt> is
automatically made available to your template, which is implicitly wrapped
in an ActionView::Helpers::PrototypeHelper#update_page block.
</p>
<p>
When an .rjs action is called with <tt>link_to_remote</tt>, the generated
JavaScript is automatically evaluated. Example:
</p>
<pre>
  link_to_remote :url =&gt; {:action =&gt; 'delete'}
</pre>
<p>
The subsequently rendered +delete.rjs+ might look like:
</p>
<pre>
  page.replace_html  'sidebar', :partial =&gt; 'sidebar'
  page.remove        &quot;person-#{@person.id}&quot;
  page.visual_effect :highlight, 'user-list'
</pre>
<p>
This refreshes the sidebar, removes a person element and highlights the
user list.
</p>
<p>
See the ActionView::Helpers::PrototypeHelper::GeneratorMethods
documentation for more details.
</p>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M001093">append_view_path</a>&nbsp;&nbsp;
      <a href="#M001090">full_template_path</a>&nbsp;&nbsp;
      <a href="#M001089">handler_for_extension</a>&nbsp;&nbsp;
      <a href="#M001092">prepend_view_path</a>&nbsp;&nbsp;
      <a href="#M001088">register_default_template_handler</a>&nbsp;&nbsp;
      <a href="#M001086">register_template_handler</a>&nbsp;&nbsp;
      <a href="#M001091">template_format</a>&nbsp;&nbsp;
      <a href="#M001087">template_handler_extensions</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->
    <div id="includes">
      <h3 class="section-bar">Included Modules</h3>

      <div id="includes-list">
        <span class="include-name"><a href="../ERB/Util.html">ERB::Util</a></span>
        <span class="include-name">CompiledTemplates</span>
        <span class="include-name">Helpers</span>
      </div>
    </div>

    <div id="section">





    <div id="attribute-list">
      <h3 class="section-bar">Attributes</h3>

      <div class="name-list">
        <table>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">assigns</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">base_path</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">controller</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">first_render</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">headers</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">logger</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">response</td>
          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">template_extension</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">template_format</td>
          <td class="context-item-value">&nbsp;[W]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">view_paths</td>
          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
          <td class="context-item-desc"></td>
        </tr>
        </table>
      </div>
    </div>
      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M001089" class="method-detail">
        <a name="M001089"></a>

        <div class="method-heading">
          <a href="#M001089" class="method-signature">
          <span class="method-name">handler_for_extension</span><span class="method-args">(extension)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001089-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001089-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/base.rb, line 255</span>
255:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">handler_for_extension</span>(<span class="ruby-identifier">extension</span>)
256:       (<span class="ruby-identifier">extension</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@@template_handlers</span>[<span class="ruby-identifier">extension</span>.<span class="ruby-identifier">to_sym</span>]) <span class="ruby-operator">||</span> <span class="ruby-ivar">@@default_template_handlers</span>
257:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001088" class="method-detail">
        <a name="M001088"></a>

        <div class="method-heading">
          <a href="#M001088" class="method-signature">
          <span class="method-name">register_default_template_handler</span><span class="method-args">(extension, klass)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001088-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001088-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/base.rb, line 250</span>
250:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">register_default_template_handler</span>(<span class="ruby-identifier">extension</span>, <span class="ruby-identifier">klass</span>)
251:       <span class="ruby-identifier">register_template_handler</span>(<span class="ruby-identifier">extension</span>, <span class="ruby-identifier">klass</span>)
252:       <span class="ruby-ivar">@@default_template_handlers</span> = <span class="ruby-identifier">klass</span>
253:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001086" class="method-detail">
        <a name="M001086"></a>

        <div class="method-heading">
          <a href="#M001086" class="method-signature">
          <span class="method-name">register_template_handler</span><span class="method-args">(extension, klass)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Register a class that knows how to handle template files with the given
extension. This can be used to implement new template types. The
constructor for the class must take the ActiveView::Base instance as a
parameter, and the class must implement a render method that takes the
contents of the template to render as well as the Hash of local assigns
available to the template. The render method ought to return the rendered
template as a string.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001086-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001086-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/base.rb, line 242</span>
242:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">register_template_handler</span>(<span class="ruby-identifier">extension</span>, <span class="ruby-identifier">klass</span>)
243:       <span class="ruby-ivar">@@template_handlers</span>[<span class="ruby-identifier">extension</span>.<span class="ruby-identifier">to_sym</span>] = <span class="ruby-identifier">klass</span>
244:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001087" class="method-detail">
        <a name="M001087"></a>

        <div class="method-heading">
          <a href="#M001087" class="method-signature">
          <span class="method-name">template_handler_extensions</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001087-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001087-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/base.rb, line 246</span>
246:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">template_handler_extensions</span>
247:       <span class="ruby-ivar">@@template_handler_extensions</span> <span class="ruby-operator">||=</span> <span class="ruby-ivar">@@template_handlers</span>.<span class="ruby-identifier">keys</span>.<span class="ruby-identifier">map</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">:to_s</span>).<span class="ruby-identifier">sort</span>
248:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M001093" class="method-detail">
        <a name="M001093"></a>

        <div class="method-heading">
          <a href="#M001093" class="method-signature">
          <span class="method-name">append_view_path</span><span class="method-args">(path)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Adds a view_path to the end of the view_paths array. This change affects
the current request only.
</p>
<pre>
  @template.append_view_path(&quot;views/default&quot;)
  @template.append_view_path([&quot;views/default&quot;, &quot;views/custom&quot;])
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001093-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001093-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/base.rb, line 440</span>
440:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">append_view_path</span>(<span class="ruby-identifier">path</span>)
441:       <span class="ruby-ivar">@view_paths</span>.<span class="ruby-identifier">push</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">path</span>)
442:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001090" class="method-detail">
        <a name="M001090"></a>

        <div class="method-heading">
          <a href="#M001090" class="method-signature">
          <span class="method-name">full_template_path</span><span class="method-args">(template_path, extension)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Gets the full template path with base path for the given template_path and
extension.
</p>
<pre>
  full_template_path('users/show', 'html.erb')
  # =&gt; '~/rails/app/views/users/show.html.erb
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001090-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001090-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/base.rb, line 378</span>
378:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">full_template_path</span>(<span class="ruby-identifier">template_path</span>, <span class="ruby-identifier">extension</span>)
379:       <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@@cache_template_extensions</span>
380:         (<span class="ruby-ivar">@@cached_base_paths</span>[<span class="ruby-identifier">template_path</span>] <span class="ruby-operator">||=</span> {})[<span class="ruby-identifier">extension</span>.<span class="ruby-identifier">to_s</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">find_full_template_path</span>(<span class="ruby-identifier">template_path</span>, <span class="ruby-identifier">extension</span>)
381:       <span class="ruby-keyword kw">else</span>
382:         <span class="ruby-identifier">find_full_template_path</span>(<span class="ruby-identifier">template_path</span>, <span class="ruby-identifier">extension</span>)
383:       <span class="ruby-keyword kw">end</span>
384:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001092" class="method-detail">
        <a name="M001092"></a>

        <div class="method-heading">
          <a href="#M001092" class="method-signature">
          <span class="method-name">prepend_view_path</span><span class="method-args">(path)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Adds a view_path to the front of the view_paths array. This change affects
the current request only.
</p>
<pre>
  @template.prepend_view_path(&quot;views/default&quot;)
  @template.prepend_view_path([&quot;views/default&quot;, &quot;views/custom&quot;])
</pre>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001092-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001092-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/base.rb, line 430</span>
430:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">prepend_view_path</span>(<span class="ruby-identifier">path</span>)
431:       <span class="ruby-ivar">@view_paths</span>.<span class="ruby-identifier">unshift</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">path</span>)
432:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M001091" class="method-detail">
        <a name="M001091"></a>

        <div class="method-heading">
          <a href="#M001091" class="method-signature">
          <span class="method-name">template_format</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
symbolized version of the :format parameter of the request, or :html by
default.
</p>
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M001091-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M001091-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/actionpack/lib/action_view/base.rb, line 418</span>
418:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">template_format</span>
419:       <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@template_format</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@template_format</span>
420:       <span class="ruby-identifier">format</span> = <span class="ruby-identifier">controller</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:request</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">request</span>.<span class="ruby-identifier">parameters</span>[<span class="ruby-identifier">:format</span>]
421:       <span class="ruby-ivar">@template_format</span> = <span class="ruby-identifier">format</span>.<span class="ruby-identifier">blank?</span> <span class="ruby-value">? </span><span class="ruby-operator">:</span><span class="ruby-identifier">html</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">format</span>.<span class="ruby-identifier">to_sym</span>
422:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>